﻿/**
*   @Copyright 2007 Vesatile Informatique
*
*   Version: 1.00
*   Creation Date:01.04.2007
*   Change Date: 23.02.2009
*   Creators Name: Anourak Bouavong
*   Last Edited By: Kalyan Bag
*   Description:[javascript css class management]
*/

function IsClassNameExist (object, checkclass) {
    var className = object.className;
    if ((" " + className + " ").replace("[\n\t\r]", " ").indexOf(checkclass) > -1) {
        return true;
    } else {
        return false;
    }
};

function GetAddedClass (object, addingclass) {
    var className = object.className;

    if (className.indexOf(" " + addingclass + " ") < 0) {
        className += " " + addingclass;
    }
    className.toString().replace("^[\s\xA0]+", "").replace("[\s\xA0]+$", "");

    return className;
};

function GetRemovedClass (object, removingclass) {
    var className = object.className;

    var className = (" " + className + " ").replace("[\n\t\r]", " ");

    className = className.replace(" " + removingclass + " ", " ");

    className.toString().replace("^[\s\xA0]+", "").replace("[\s\xA0]+$", "");

    return className;
};
